package com.ap.core.validation.message.rules;

import com.ap.core.cxf.jaxb.managertp.SubmitRTPMessageType;
import com.ap.core.message.info.RequestMessageInfo;
import com.ap.core.message.managertp.info.SubmitRTPMessageInfo;
import com.ap.core.validation.message.info.MessageValidationInfo;
import com.ap.core.validation.message.info.OriginalInfo;

/**
 * User: Ranjit.Singh
 * Check if provided Distributor ID is valid
 */
public class RV0001Rule  extends AbstractDistributorCheckRule<RequestMessageInfo<SubmitRTPMessageType>, OriginalInfo> {

    @Override
    public boolean validate(MessageValidationInfo<RequestMessageInfo<SubmitRTPMessageType>, OriginalInfo> infoObject) {
    	String distributorIdentification = ((SubmitRTPMessageInfo)infoObject.getBoundObject()).getRTPSenderInfo().getDistributorInfo().getDistributorId();
        return isDistributorExists(distributorIdentification);
    }


}
